laravel migration change default value

40

laravel migration default value -

$table->increments('id');
            $table->string('name');
            $table->string('url');
            $table->string('country');
            $table->tinyInteger('status')->default('1');
            $table->timestamps();

laravel migration change default value -

Schema::table('users', function ($table) {
    $table->integer('active')->default(0)->change();
});

how assign default value to laravel migration column -

You can use change() method:

Schema::table('users', function ($table) {
    $table->integer('active')->default(0)->change();
});

Comments

Submit
0 Comments